home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue26 / tiptrix / LISTING2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-09-17  |  623 b   |  28 lines

  1. unit Test;
  2.  
  3. interface
  4.  
  5. uses 
  6.   Windows, SysUtils, Classes, Messages,Menus, Graphics, Controls, Forms, Consts,
  7.   Dialogs, ClassPlug;
  8.  
  9.  THookControl = class( TWinControl);
  10.    protected
  11.      Procedure WMPaint(Var Message: TWMPAINT); message WM_PAINT;
  12.  end;
  13.  
  14. Implementation
  15.  
  16.  Procedure THookControl.WMPaint(Var Message: TWMPAINT);
  17.  begin
  18.   // Do your thing....
  19.   inherited; // Important!! Ok?
  20.  end;
  21.  
  22.  Initialization // Make the change
  23.    ReplaceClassParent( TPanel, TWinControl, THookControl);
  24.  
  25.  Finalization // Restore to be clean...
  26.    ReplaceClassParent( TPanel, THookControl, TWinControl);
  27.  end.
  28.